Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Production Court #976

Merged
merged 315 commits into from
Aug 23, 2023
Merged

Conversation

Chralt98
Copy link
Member

@Chralt98 Chralt98 commented Feb 15, 2023

Fixes #858 and fixes #864 and fixes #980 Fixes #848

Forecasting Technologies provides the voting possibilities on the front end. As long as jurors vote in secret on these outcomes, we are fine. Because no one would even think about voting for another outcome, which is not in the provided set. These jurors would loose some of their stake.

@Chralt98 Chralt98 self-assigned this Feb 15, 2023
@Chralt98 Chralt98 added the s:in-progress The pull requests is currently being worked on label Feb 15, 2023
@Chralt98
Copy link
Member Author

Chralt98 commented Feb 16, 2023

Needs to go after #938 !

@sea212
Copy link
Member

sea212 commented Feb 21, 2023

Why is #967 a precondition of adding secret votes to court? I can't see any causal connection here.

@Chralt98
Copy link
Member Author

Chralt98 commented Feb 21, 2023

@sea212 Good question. The reason for this is the nature of secret voting. Say for example we don't reduce the number of possibilities for voting outcomes (without crowdfunding). Then it's pretty hard for the court participants to find a good plurality decision. Especially for scalar markets. You could end up in the situation that similar outcomes do get votes, but strictly speaking they are not the same and the court would not have a clear plurality. Does this sound reasonable?

@sea212
Copy link
Member

sea212 commented Feb 21, 2023

I understand the problematic and I think it's important to resolve this. However, getting Court ready is more important and in the beginning weeks we can workaround this issue by Forecasting Technologies taking the responsibility to provide sensible disputes outcomes to disputes.

@Chralt98
Copy link
Member Author

Chralt98 commented Feb 21, 2023

We (@sea212 and I) decided to allow the Advisory Committee to appeal. This allows us to save time and ignore the crowdfunding mechanism for now.

@Chralt98
Copy link
Member Author

Chralt98 commented Feb 23, 2023

Please review only the court lib.rs for now. As long as #938 is not merged, it's very hard to grasp what other noteworthy changes I made. So let me get quick feedback from you, if you agree that my implementation is impressive.

@Chralt98 Chralt98 marked this pull request as ready for review February 23, 2023 09:54
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Feb 23, 2023
@Chralt98 Chralt98 requested review from maltekliemann and sea212 and removed request for maltekliemann February 23, 2023 09:54
@Chralt98 Chralt98 added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Feb 23, 2023
@Chralt98 Chralt98 changed the title Add secret voting for court Implement Production Court without secure randomness Feb 28, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2023

Codecov Report

❗ No coverage uploaded for pull request base (release-dispute-system@d5aa135). Click here to learn what that means.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@                    Coverage Diff                    @@
##             release-dispute-system     #976   +/-   ##
=========================================================
  Coverage                          ?   94.49%           
=========================================================
  Files                             ?       95           
  Lines                             ?    26396           
  Branches                          ?        0           
=========================================================
  Hits                              ?    24942           
  Misses                            ?     1454           
  Partials                          ?        0           
Flag Coverage Δ
tests 94.49% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Mar 1, 2023
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@maltekliemann maltekliemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm stopping here because I think there may be a few fundamental changes necessary. There are two points I'm getting hung up on and I'm not sure if I understand the logic correctly:

  • It seems like it is impossible for two jurors to have the same stake. Seems like a design smell in the sense that:

    1. There should be a better solution for organizing jurors
    2. It leads to problems down the road. For example, if Alice has a stake of 3 * MinStake and Bob has a stake of 2 * MinStake and then Alice gets slashed, reducing her stake to 2 * MinStake, what happens then (didn't check if you have a solution for that)?
  • It seems like you're slashing (at least in denounce_vote) a percentage of draw.slashable, which, if I read select_jurors correctly, is equal to the full stake of the drawn juror. That's a problem, as it allows each user to split their stake over multiple accounts, which keeps their chances to be selected as juror the same (ignoring they might get removed from the pool entirely) but reduces their risk.

    For example, if MinStake = 10 and Alice wants to stake 100, she can use on account. If she's selected as juror, then a certain percentage (say 50%) of her entire stake is at risk. For example, she might lose 50 if she's denounced. On the other hand, if she splits her 100 over ten accounts, and one of them is chosen and that draw is denounced, then she will only lose 5.

Again, not quite sure if I'm reading the code correctly. It might help if you documented the types.rs so that I don't have to work through the entire lib.rs to understand what each field does.

zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
zrml/court/src/lib.rs Show resolved Hide resolved
zrml/court/src/lib.rs Outdated Show resolved Hide resolved
@Chralt98 Chralt98 removed the s:review-needed The pull request requires reviews label Mar 6, 2023
@Chralt98 Chralt98 added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Aug 22, 2023
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Aug 22, 2023
@Chralt98 Chralt98 requested a review from sea212 August 22, 2023 18:08
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:review-needed The pull request requires reviews labels Aug 23, 2023
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:review-needed The pull request requires reviews labels Aug 23, 2023
Comment on lines +25 to +57
- ⚠️ Add court production implementation ([#976]).
Dispatchable calls are:
- `join_court` - Join the court with a stake to become a juror in order to get the stake-weighted
chance to be selected for decision making.
- `delegate` - Join the court with a stake to become a delegator in order to
delegate the voting power to actively participating jurors.
- `prepare_exit_court` - Prepare as a court participant to leave the court system.
- `exit_court` - Exit the court system in order to get the stake back.
- `vote` - An actively participating juror votes secretely on a specific court case,
in which the juror got selected.
- `denounce_vote` - Denounce a selected and active juror, if the secret and
vote is known before the actual reveal period.
- `reveal_vote` - An actively participating juror reveals the previously casted secret vote.
- `appeal` - After the reveal phase (aggregation period), the jurors decision can be appealed.
- `reassign_juror_stakes` - After the appeal period is over,
losers pay the winners for the jurors and delegators.
- `set_inflation` - Set the yearly inflation rate of the court system.
Events are:
- `JurorJoined` - A juror joined the court system.
- `ExitPrepared` - A court participant prepared to exit the court system.
- `ExitedCourt` - A court participant exited the court system.
- `JurorVoted` - A juror voted on a specific court case.
- `JurorRevealedVote` - A juror revealed the previously casted secret vote.
- `DenouncedJurorVote` - A juror was denounced.
- `DelegatorJoined` - A delegator joined the court system.
- `CourtAppealed` - A court case was appealed.
- `MintedInCourt` - A court participant was rewarded with newly minted tokens.
- `StakesReassigned` - The juror and delegator stakes have been reassigned.
The losing jurors have been slashed.
The winning jurors have been rewarded by the losers.
The losing jurors are those, who did not vote, or did not vote with the plurality,
were denounced or did not reveal their vote.
- `InflationSet` - The yearly inflation rate of the court system was set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not part of 0.3.9.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do this on the release-dispute-system branch.

components which query the chain's storage, the extrinsics or the runtime
APIs/RPC interface.

## v0.3.9

[#976]: https://github.com/zeitgeistpm/zeitgeist/pull/976
[#937]: https://github.com/zeitgeistpm/zeitgeist/pull/937
[#903]: https://github.com/zeitgeistpm/zeitgeist/pull/903

### Changed

- ⚠️ Add `outsider` field to `MarketBonds` struct. In particular, the `Market`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format this using prettier.

@Chralt98 Chralt98 added s:accepted This pull request is ready for merge and removed s:review-needed The pull request requires reviews labels Aug 23, 2023
@Chralt98 Chralt98 merged commit 328753d into release-dispute-system Aug 23, 2023
@Chralt98 Chralt98 deleted the chralt98-court-overhaul branch August 23, 2023 14:06
Chralt98 added a commit that referenced this pull request Aug 26, 2023
* ZIP-0 Part II (#938)

* move disputes to simple-disputes

* move more to simple-disputes

* wip

* wip

* some mock preparation

* wip

* fix tests

* taplo fmt

* update court authorized mdms

* add dispute bond to market storage

* mdm funds flow

* fix clippy

* fix pm benchmarks

* add migration

* simplify migration

* correct migration

* migration fixes and call filter

* correct admin_destroy_market benchmark

* improve simple-disputes mock

* benchmark reserve_outcome

* benchmark reserve_outcome

* fix weights file

* fix after merge

* add migration tests

* add migration reserve id test

* apply review suggestions

* rename reserve_outcome to suggest_outcome

* separate resolve_disputed_market into parts

* edit exchange API documentation

* slash dispute bond

* add empty commit

* correct admin_destroy_market test

* remove gd dependency from simple disputes

* Update zrml/simple-disputes/src/mock.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/simple-disputes/src/mock.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/prediction-markets/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* add doc string

* add doc strings

* Reduce settle_bonds LOC

* cargo fmt

* Update zrml/prediction-markets/src/migrations.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/prediction-markets/src/migrations.rs

Co-authored-by: Harald Heckmann <[email protected]>

* apply review suggestion

* add correct mdm benchmarking on_dispute

* use on_dispute_weight inside api

* improve mdm weight technique

* add mdm weights to on_resolution

* add tests for pm

* modify migration logs, fix try-runtime

* little benchmark fix

* Update zrml/authorized/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/authorized/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* use result with weight struct

* improve dispute api weight system

* Use accurate dispute weight instead of max

* fix clippy

* Update zrml/prediction-markets/src/migrations.rs

Co-authored-by: Malte Kliemann <[email protected]>

* add copyrights

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: Malte Kliemann <[email protected]>

* fix clippy

* fix clippy

* Update dependencies to v0.9.38

* More dependency updates

* Update standalone runtimes

* Fix build with feature runtime-benchmark

* Update Zeitgeist parachain runtime

* Update Battery Station parachain runtime

* Deduplicated dependencies

* Make tests succeed for parachain runtime

* Partially fix Zeitgeist xcm tests

* Make all runtime tests succeed

* Update standalone client

* Update parachain node

* Add migrations

* Cargo fmt

* Satisfy Clippy

* Cargo fmt

* Taplo format

* Update licenses

* remove outsider bond from migration

* Reduce runtime test dependencies by half

* small changes

* Add missing runtime-benchmark feature

* Use upper case copyright name

Strange, locally the copyright script says: "All copyright notices are up to date! 🍉"
On GH pipeline: "error: zrml/prediction-markets/src/benchmarks.rs: no copyright notice for Forecasting Technologies LTD found"

* Remove test logger

* Implement Production Court (#976)

* apply review suggestions

* rename reserve_outcome to suggest_outcome

* separate resolve_disputed_market into parts

* add debug asserts

* document types

* modify sort check

* avoid double remove

* clarify docs

* avoid mut

* binary search by account id

* Revert "binary search by account id"

This reverts commit c04d5ff.

* make pool item key unique

* use secure random number generator

* add tests

* add tests

* found bug in exit court

* correct slashable

* fix exit court

* correct tests

* fix bug, add tests

* fix second get_winner bug

* modify tests

* fix draw active lock bug, add tests

* rename total_slashable to consumed_stake

* update config parameters, tests

* modify params and add tests

* add denounce tests

* increase code safety

* add tests

* add tests

* edit exchange API documentation

* slash dispute bond

* add empty commit

* correct admin_destroy_market test

* revert get_resolution_outcome to on_resolution

* remove gd dependency from simple disputes

* use appealed outcomes for global dispute

* modify appeal bond formula

* remove slash percentages

* benchmark court

* Update zrml/court/src/types.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/types.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/mock_storage.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/tests.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/tests.rs

Co-authored-by: Malte Kliemann <[email protected]>

* periods to round timing, modify tests

* modify doc comments

* use onunbalanced

* improve RequestInterval documentation

* improve consumed_stake documentation

* remove court from filter

* add treasury to court

* correct errors

* update comment

* update get_pool_item comment

* update get_pool_item comment

* comment juror pool

* improve doc comments

* cargo fmt

* rename constants

* edit court pallet doc

* update tests

* rename secret to commitment

* make commit reveal failsafer

* outsource commitment function

* update doc comments

* merge punish tardy jurors reassign juror stakes

* outsource get_n_random_numbers

* correct logs

* rename default to get

* improve extrinsic comments

* simplify choose_multiple_weighted

* improve naming

* remove back_global_dispute

* unlock jurors from last draws

* improve error description

* shorten mock periods

* document private functions

* add assert to check max appeals

* add stake to juror joined event

* correct test

* improve test

* update reassigned event comment

* correct test

* add assert check

* improve tests for draws

* add reveal vote invalid salt fails test

* denounce slash inside reassign_juror_stakes

* improve test readibility

* rename periods to cycle_ends

* add select jurors test

* change randomness source in court tests

* fix clippy

* imrpove tests

* remove cccount lookup in tests

* improve test setup

* add API tests, add missing unlockings

* add full cycle court tests

* remove invalid test

* add missing WeightInfo

* add inflation inside court

* improve benchmarking and testing

* add integrity_test

* Update zrml/simple-disputes/src/mock.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/simple-disputes/src/mock.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/prediction-markets/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* add doc string

* add doc strings

* Reduce settle_bonds LOC

* cargo fmt

* Update zrml/prediction-markets/src/migrations.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/prediction-markets/src/migrations.rs

Co-authored-by: Harald Heckmann <[email protected]>

* apply review suggestion

* add GDItem integration

* add delegations

* improve code structure

* fix benchmarks

* optimize logic

* add correct mdm benchmarking on_dispute

* use on_dispute_weight inside api

* improve mdm weight technique

* add mdm weights to on_resolution

* add tests for pm

* modify migration logs, fix try-runtime

* adjust tests for binary search

* improve benchmarking

* do small change

* little benchmark fix

* Update zrml/authorized/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/authorized/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* use result with weight struct

* improve code

* update benchmark and weights

* improve dispute api weight system

* test delegations for reassign

* correct benchmarks and test

* remove comment

* add API benchmarks

* update weights

* use generic vote item instead of outcome report

* update to court id and generic court

* fix stuff and add documentation

* add court readme, use new parameters

* improve naming, weighting

* Use accurate dispute weight instead of max

* take random ranges without replacement

* switch get_random_number algo

* integrate court and reject simple disputes

* update start_global_dispute bench

* fix clippy

* use efficient draw without replacement algorithm

* small edits

* round to min juror stake, use other draw algo

* use partial fisher yates algorithm

* improve naming and comments

* update changelog for devs

* improve dispute api documentation

* correct call filters

* add copyright notice

* remove is_outcome and is_binary

* remove unnecessary "Court" prefix

* update copyright notices

* remove front end comment

* Update zrml/court/README.md

Co-authored-by: Malte Kliemann <[email protected]>

* npx prettier court readme

* improve style of terminology

* update readme

* remove unnecessary impl block

* update comment

* remove todo

* make reward_pot package private

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* update integrity test

* improve join court doc

* improve extrinsic documentation

* update delegate doc

* make some types package private

* fix struct comment

* update readme

* update readme

* remove commitment matcher

* fix doc string

* remove unnecessary error

* improve import

* improve test case

* fix inflation misbehaviour

* improve round timing structure

* improve error names

* fix get_valid_delegated_juror

* remove wrong break

* update weight for select jurors

* allow rejoin after exit preparation

* remove unnecessary apis

* improve naming and docs

* fix clippy

* fix copyrights

* update changelog for devs

* Update runtime/common/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* comment benchmark components

* comment benchmark component

* Update zrml/court/README.md

Co-authored-by: Harald Heckmann <[email protected]>

* add terminology for court

* Update zrml/prediction-markets/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* restructure import

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* use mul_floor and reduce indentation

* safe guard inflation emission

* use imbalance for minting

* use saturated div

* logging if inflation period mint too high

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* reduce court InflationPeriod for Battery Station

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* fmt

* fix tests

* fix issue tokens without burn

* remove unnecessary error return

* allow equal amount to previous stake

---------

Co-authored-by: Malte Kliemann <[email protected]>
Co-authored-by: Harald Heckmann <[email protected]>

* [Global Disputes] Fix issues after first battery station live test (#912)

* apply review suggestions

* use keep alive

* cargo fmt

* use function instead of raw

* improve documentation

* improve 2 outcome check

* start gd requires two unqiue outcomes

* fix error

* add empty commit

* correct admin_destroy_market test

* revert get_resolution_outcome to on_resolution

* remove gd dependency from simple disputes

* fix clippy

* use appealed outcomes for global dispute

* fix tests and benchmarks

* modify appeal bond formula

* remove slash percentages

* test default toolchain

* benchmark court

* Update zrml/court/src/types.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/types.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/mock_storage.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/tests.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update zrml/court/src/tests.rs

Co-authored-by: Malte Kliemann <[email protected]>

* periods to round timing, modify tests

* modify doc comments

* use onunbalanced

* improve RequestInterval documentation

* improve consumed_stake documentation

* remove court from filter

* add treasury to court

* correct errors

* update comment

* update get_pool_item comment

* update get_pool_item comment

* comment juror pool

* improve doc comments

* cargo fmt

* rename constants

* edit court pallet doc

* update tests

* rename secret to commitment

* make commit reveal failsafer

* outsource commitment function

* Update scripts/tests/misc.sh

* update doc comments

* merge punish tardy jurors reassign juror stakes

* outsource get_n_random_numbers

* correct logs

* rename default to get

* improve extrinsic comments

* simplify choose_multiple_weighted

* improve naming

* remove back_global_dispute

* unlock jurors from last draws

* improve error description

* shorten mock periods

* document private functions

* add assert to check max appeals

* add stake to juror joined event

* correct test

* improve test

* update reassigned event comment

* correct test

* add assert check

* improve tests for draws

* add reveal vote invalid salt fails test

* denounce slash inside reassign_juror_stakes

* improve test readibility

* rename periods to cycle_ends

* add select jurors test

* change randomness source in court tests

* fix clippy

* imrpove tests

* remove cccount lookup in tests

* improve test setup

* add API tests, add missing unlockings

* add full cycle court tests

* remove invalid test

* add missing WeightInfo

* add inflation inside court

* improve benchmarking and testing

* add integrity_test

* Update zrml/simple-disputes/src/mock.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/simple-disputes/src/mock.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/prediction-markets/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* add doc string

* add doc strings

* Reduce settle_bonds LOC

* cargo fmt

* Update zrml/prediction-markets/src/migrations.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/prediction-markets/src/migrations.rs

Co-authored-by: Harald Heckmann <[email protected]>

* apply review suggestion

* add GDItem integration

* add delegations

* improve code structure

* fix benchmarks

* optimize logic

* add correct mdm benchmarking on_dispute

* use on_dispute_weight inside api

* improve mdm weight technique

* add mdm weights to on_resolution

* add tests for pm

* modify migration logs, fix try-runtime

* adjust tests for binary search

* improve benchmarking

* do small change

* little benchmark fix

* Update zrml/authorized/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/authorized/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* use result with weight struct

* improve code

* update benchmark and weights

* improve dispute api weight system

* test delegations for reassign

* correct benchmarks and test

* remove comment

* add API benchmarks

* update weights

* use generic vote item instead of outcome report

* update to court id and generic court

* fix stuff and add documentation

* add court readme, use new parameters

* improve naming, weighting

* Use accurate dispute weight instead of max

* take random ranges without replacement

* add start_global_dispute tests

* add test

* fix typo

* switch get_random_number algo

* integrate court and reject simple disputes

* update start_global_dispute bench

* fix clippy

* use efficient draw without replacement algorithm

* small edits

* round to min juror stake, use other draw algo

* use partial fisher yates algorithm

* improve naming and comments

* update changelog for devs

* improve dispute api documentation

* correct call filters

* add copyright notice

* remove is_outcome and is_binary

* remove unnecessary "Court" prefix

* update copyright notices

* remove front end comment

* Update zrml/court/README.md

Co-authored-by: Malte Kliemann <[email protected]>

* npx prettier court readme

* improve style of terminology

* update readme

* remove unnecessary impl block

* update comment

* remove todo

* make reward_pot package private

* Update zrml/court/src/lib.rs

Co-authored-by: Malte Kliemann <[email protected]>

* update integrity test

* improve join court doc

* improve extrinsic documentation

* update delegate doc

* make some types package private

* fix struct comment

* update readme

* update readme

* remove commitment matcher

* fix doc string

* remove unnecessary error

* improve import

* improve test case

* fix inflation misbehaviour

* improve round timing structure

* improve error names

* fix get_valid_delegated_juror

* remove wrong break

* update weight for select jurors

* allow rejoin after exit preparation

* remove unnecessary apis

* improve naming and docs

* fix clippy

* correct migrations

* fix copyrights

* fmt

* fix clippy

* fix copyrights

* update changelog for devs

* Update runtime/common/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* comment benchmark components

* comment benchmark component

* Update zrml/court/README.md

Co-authored-by: Harald Heckmann <[email protected]>

* add terminology for court

* Update zrml/prediction-markets/src/benchmarks.rs

Co-authored-by: Harald Heckmann <[email protected]>

* restructure import

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* use mul_floor and reduce indentation

* safe guard inflation emission

* use imbalance for minting

* use saturated div

* logging if inflation period mint too high

* fix after merge

* update changelog for devs

* use imperative

* fmt

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* reduce court InflationPeriod for Battery Station

* Update zrml/court/src/lib.rs

Co-authored-by: Harald Heckmann <[email protected]>

* fmt

* fix tests

* fix issue tokens without burn

* remove unnecessary error return

* Update Makefile

* allow equal amount to previous stake

---------

Co-authored-by: Malte Kliemann <[email protected]>
Co-authored-by: Harald Heckmann <[email protected]>

* activate court and GD on battery station

* bump storage version of market commons

* Update runtime/zeitgeist/src/lib.rs

* Update runtime/zeitgeist/src/lib.rs

* Revert "Reduce runtime test dependencies by half"

This reverts commit fe589a5.

* Update weight templates

* Use header option for benchmarks

Also format benchmark script and moves header file into HEADER_GPL3.

* Update rust-toolchain

* Satisfy clippy

* Use patched wasm-builder for new rustc

* Format

* Update licenses

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: Malte Kliemann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i:transactions-changed ⚠️ Implies change in transaction version s:accepted This pull request is ready for merge
Projects
None yet
4 participants